AM_CPPFLAGS += $(HAVE_OCC_DEF) \
           -DSRCDIR=@srcdir@ \
           -I$(top_srcdir)/src/geom/cgm \
           -I$(top_srcdir)/src/util/cgm \
           -I$(top_builddir)/src/util/cgm \
           -I$(top_srcdir)/src/init/cgm \
           -I$(top_builddir)/src/init/cgm \
           -I$(top_builddir)/src/geom/cgm \
           -I$(top_srcdir)/src/geom/virtual/cgm \
           -I$(top_srcdir)/src/geom/facet/cgm \
           -I$(top_srcdir)/src/geom/Cholla/cgm \
           -I$(top_srcdir)/src/init/cgm \
	   -I$(top_srcdir)/src/geom/OCC/cgm \
	   -I$(srcdir) \
	   $(OCC_INC_FLAG)

TESTS = init  facets fileoptions

if DEV
  TESTS += modify makept
endif

if build_OCC
  TESTS += sheet edgeFaceSense raySurfaceInt attribute_to_file loft offset_curves point_project imprint_bug subtract test_occ brick_occ operation section AngleCalc_occ  CreateGeometry_occ GraphicsData_occ brick_facet  spheres cylinders multifaceted_works multifaceted_2trisPerSurface_works multifaceted split_circle merge_occ r_w groups_saved_to_OCC merge_facet scale
endif
if BUILD_CGM
  TESTS += test_stl
endif

check_PROGRAMS = $(TESTS)

if build_OCC
  check_PROGRAMS += modify makept
endif

noinst_LTLIBRARIES = libcgm_test.la

if BUILD_CGM
  LDADD = ../src/libcgm.la libcgm_test.la ../src/geom/Cholla/libcgm_cholla.la ../src/util/libcgm_util.la ../src/geom/virtual/libcgm_virtual.la $(CGM_EXT_LIBS)
endif

libcgm_test_la_SOURCES = TestUtilities.hpp \
                         TestUtilities.cpp

groups_saved_to_OCC_SOURCES = groups-saved-to-OCC.cxx
multifaceted_2trisPerSurface_works_SOURCES = multifaceted-2trisPerSurface-works.cxx
multifaceted_works_SOURCES = multifaceted-works.cxx
multifaceted_SOURCES = multifaceted.cpp
cylinders_SOURCES = cylinders.cpp
split_circle_SOURCES = split_circle.cpp
spheres_SOURCES = spheres.cpp
scale_SOURCES = scale.cpp
fileoptions_SOURCES = fileoptions.cpp
makept_SOURCES = makept.cpp
offset_curves_SOURCES = offset_curves.cpp
loft_SOURCES = loft.cpp
modify_SOURCES = modify.cpp
imprint_bug_SOURCES = imprint_bug.cpp
subtract_SOURCES = subtract.cpp
section_SOURCES = section.cpp
sheet_SOURCES  = sheet.cpp
r_w_SOURCES    = r_w.cpp
test_occ_SOURCES = test_occ.cpp
point_project_SOURCES = point_project.cpp
operation_SOURCES = operation.cpp
init_SOURCES = init.cpp
facets_SOURCES = facets.cpp
edgeFaceSense_SOURCES = edgeFaceSense.cpp
attribute_to_file_SOURCES = attribute_to_file.cpp
attribute_to_file_CPPFLAGS = $(CPPFLAGS) $(AM_CPPFLAGS) -DTEST_OCC
test_stl_SOURCES = test_stl.cpp

raySurfaceInt_SOURCES = raySurfaceInt.cpp

brick_sources = brick.cpp
brick_occ_SOURCES = $(brick_sources)
brick_occ_CPPFLAGS = $(CPPFLAGS) $(AM_CPPFLAGS) '-DTEST_ENGINE="OCC"'
brick_facet_SOURCES = $(brick_sources)
brick_facet_CPPFLAGS = $(CPPFLAGS) $(AM_CPPFLAGS) '-DTEST_ENGINE="FACET"'

merge_sources = merge_test.cpp

merge_occ_SOURCES = $(merge_sources)
merge_occ_CPPFLAGS = $(CPPFLAGS) $(AM_CPPFLAGS) -DTEST_OCC
merge_facet_SOURCES = $(merge_sources)
merge_facet_CPPFLAGS = $(CPPFLAGS) $(AM_CPPFLAGS) -DTEST_FACET

AngleCalc_occ_SOURCES = AngleCalc.cpp
AngleCalc_occ_CPPFLAGS = $(CPPFLAGS) $(AM_CPPFLAGS) -DTEST_OCC


CreateGeometry_occ_SOURCES = CreateGeometry.cpp
CreateGeometry_occ_CPPFLAGS = $(CPPFLAGS) $(AM_CPPFLAGS) -DTEST_OCC

GraphicsData_occ_SOURCES =  GraphicsData.cpp
GraphicsData_occ_CPPFLAGS = $(CPPFLAGS) $(AM_CPPFLAGS) -DTEST_OCC

# Files that are used as input to tests, and therefore
# must be included in tarball for tests to run.
EXTRA_DIST = 62_shaver1.brep \
             66_shaver3.brep \
             72_shaver6.brep \
             LeverArm.brep \
             unite1.occ\
             pieceOfTorus01.stp \
             unite4.occ \
             proe.stp   \
             diffuser.iges   \
             ex3.iges   \
             Cylinder_1.brep   \
             Cylinder_2.brep   \
             webcut.brep     \
             Line_1.brep    \
             Line_2.brep    \
             stitch.name_occ \
             box-w-hole.brep \
             Solid_2.brep \
             Solid_6.brep  \
             Solid_7.brep \
             s5.stp \
             unit_cube.stl

# Files that are created by tests, and that therefore
#  - should be removed during 'make clean'
#  - should not be included in tarball
MOSTLYCLEANFILES = \
        point.occ \
        stitch.occ \
        beforesub.occ \
        beforesub2.occ \
        aftersub.occ \
        unite2.occ \
        unite3.occ \
        unite5.occ \
        unite6.occ \
  groups_saved.occ \
        proeexport.iges \
        proe.occ \
        diffuser.occ \
        proeexport.step \
        ex3export.step \
        ex3.occ \
        ex3export.iges \
        prism.occ \
        pyramid.occ \
        fillet.occ \
        curves.brep \
        multifaceted-2trisPerSurface-works.stl \
        multifaceted-works.stl \
        multifaceted.stl \
        mmgr.log \
        unit_cube.facet

EXTRA_DIST += CMakeLists.txt

